package com.xunshangwang.pinhaohuo.decorations;

import android.content.Context;
import android.graphics.Rect;
import android.support.annotation.IdRes;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by xzp on 16/2/17.
 */
public class OffsetItemDecoration extends RecyclerView.ItemDecoration{
    private int mOffset;
    public OffsetItemDecoration(Context context,int resId){
        mOffset=context.getResources().getDimensionPixelSize(resId);
    }

    public int getOffset() {
        return mOffset;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        //super.getItemOffsets(outRect, view, parent, state);
        outRect.set(0,0,0,mOffset);
    }
}
